web: ship the editors and .odm tools behind real routes - #1183
Conversation
The last two nav stubs become tools. .odm rendering resolves the master's external chapter files from a second file picker: odmToPdf runs in the worker over the picked map, and OdmUnresolvedSectionError crosses the rpc boundary as data -- the named list of still-missing chapters IS the tool's UX, not an error to hide. The editors tool drives documents.js's live-view editors through worker-held sessions: open holds the editor and answers a paragraph snapshot, each mutation edits the live document in place (set-text is position-preserving -- first run takes the whole text, remaining runs leave) and answers a fresh snapshot, and save re-serialises through the format's own writer. The v1 surface is the paragraph operations every paragraph-family editor exposes identically, so one UI drives docx, odt, doc, and markdown; deeper per-run styling stays out until it has the same genuine cross-format surface.
…al routes The navigation spec still pinned the #1096 stub contract (data-disabled, URL unchanged on click) for the two tools that now ship real routes -- they join the real-tools table with their routes' own headings.
|
@codex security review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
Security findingsAdvisory findings (1)ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
🎉 This PR is included in version 2.11.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
There was a problem hiding this comment.
🛡️ Codex Security Review
Here are some automated security review suggestions for this pull request.
Reviewed commit: eeff9a1775
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
| const pdf = odmToPdf(input.master, { | ||
| resolveSubDocument: (href) => byHref.get(href), | ||
| }); |
There was a problem hiding this comment.
🛡️ Codex Security Review
Security: Bound repeated ODM chapter expansion
When a user follows the new two-file flow with an attacker-supplied .odm and matching .odt, bound or deduplicate chapter expansion before calling odmToPdf. The master may repeat one href arbitrarily; this callback returns the same bytes each time, while odmToPdf decodes and parses that archive once per section and lays out every copy. A 42 KB master can encode 100,000 references, causing 100,000 decompressions and an enormous PDF that exhausts the dedicated worker/tab. Zod only checks types, and this handler supplies no count, cumulative-byte limit, or cancellation signal. This is in-scope hostile-document resource exhaustion.
SECURITY.md reference: SECURITY.md:L15-L18
Useful? React with 👍 / 👎.
Replaces #1182, closed unmerged with its branch reset before merge -- same two commits (plus the e2e spec fix asserting the real-tools contract), rebased onto current main. Nothing equivalent landed: editors.tsx is absent from main and #1096 remains open.
Closes #1096. Package/JSON and .odb had already landed; this ships the two remaining stubs: .odm (odm.render rpc over odmToPdf with a caller-supplied chapter map, unresolved chapters rendered as the route's core UX) and Editors (worker-held live-view sessions -- open/setParagraphText/addParagraph/removeParagraph/save -- over documents.js's docx/odt/doc/markdown editors, one UI for all four formats, save through each format's own writer). The navigation e2e spec now asserts both tools navigate to their real routes; full vite build with PWA precache green.